<?php
// Open Header, include functions and get the showid and cached xml
include 'functions.php';
loadheader();

$show = $_POST['show'];
if (($show) && ($show != "Search for Show")) {

$xml = simplexml_load_file('http://services.tvrage.com/feeds/search.php?show='.make_safe($show));
echo "<p><div align=left class=searchtitle>Search Results:</div></p>";

foreach($xml->show as $results) {
	echo "<div class=\"resultsname\">".$results->name."</div> - <a href=\"".$results->link."\">TVRage.com Page</a> | <a href=\"eplist.php?sid=".$results->showid."\">Full Episode List</a><br>";
}

}else{
	
include './style/searchtmpl.html';

}
loadfooter();
?> 